<?php
   @include_once("connect.php");


    $id=$_POST["id"];
    $gid=$_POST["gid"];
    
     $sql = "delete from `user_shoppingcar` where id=$id and gid=$gid";
        $result=mysqli_query($conn,$sql);
        $obj=array();
        if($result){
             $rows = mysqli_affected_rows($conn);

               // echo $rows;
                if($rows>0){ // 删除成功
                    $obj["status"] = true;
                    $obj["msg"] = "删除成功";
                }else{
                    $obj["status"] = false;
                    $obj["msg"] = "删除失败,数据不存在";
                }
        }else{
        $obj['status']=false;
        }

        echo json_encode($obj);

?>